package com.LatitudeYao;

/**
 * Created by GTS on 2017/8/15.
 */
public class LiftOff implements Runnable {
    public int countDown = 10;
    public static int taskCount = 0;
    public final int id = taskCount++;
    public LiftOff(){}
    public LiftOff(int countDown){
        this.countDown = countDown;
    }
    public String status(){
        return  "#"+id+"("+((countDown > 0) ? countDown : "LiftOff")+")";
    }
    public void run(){
        while(countDown -- > 0){
            System.out.println(status());
            Thread.yield();
        }
    }
}
